package com.phy.gsjl.entity;

import java.util.List;

/**
 * 分页
 * @author Administrator
 *
 */
public class Page {
	
	/**
	 * 表示查询后一共得到多少条结果记录
	 */
	private Integer totalRecord;

	/**
	 * 表示页面一次要显示多少条记录
	 */
	private Integer pageSize;

	/**
	 * 表示将所有的记录进行分页后，一共有多少页
	 */
	private Integer totalPage;

	/**
	 * 表示从所有的结果记录中的哪一个编号开始分页查询
	 */
	private Integer startIndex;

	/**
	 * 表示用户想看的页数
	 */
	private Integer currentPage;

	public Page() {

	}

	public Page(Integer totalRecord, Integer pageSize, Integer currentPage) {
		this.totalRecord = totalRecord;
		this.pageSize = pageSize;
		this.currentPage = currentPage;
		
		if (this.totalRecord % this.pageSize == 0) {
			this.totalPage = this.totalRecord / this.pageSize;
		} else {
			this.totalPage = this.totalRecord / this.pageSize + 1;
		}
		
		this.startIndex = (this.currentPage - 1) * this.pageSize;
	}

	public Integer getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(Integer totalRecord) {
		this.totalRecord = totalRecord;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	public Integer getStartIndex() {
		return startIndex;
	}

	public void setStartIndex(Integer startIndex) {
		this.startIndex = startIndex;
	}

	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
	
}
